package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsChangeQuotesPageUtil extends SeleniumPageUtil {

	public final static By CCQ_TD_USER_SELECT			= By.id("ContractChgRequestsDashboard1_tdUserSelect");
	public final static By CCQ_INPUT_USER				= By.id("ContractChgRequestsDashboard1_txtUser");
	public final static By CCQ_DIV_RESULT_PAGE		= By.xpath("//*[@id='ContractChgRequestsDashboard1_lblPaging']/div");
	public final static By CCQ_TD_CONTRACTS			= By.xpath("//*[@id='pnlChgReq']/table/tbody/tr/td[5]");
	public final static By CCQ_SPAN_REC_NUM			= By.id("ContractChgRequestsDashboard1_lblNumRecs");
	public final static By CCQ_SPAN_SCOPE				= By.id("ContractChgRequestsDashboard1_lblScope");
	public final static By CCQ_FILTER_CONTRACT_ID		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[1]/div/img[1]");
	public final static By CCQ_FILTER_CUSTOMER		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[2]/div/img[1]");
	public final static By CCQ_FILTER_TYPE		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[3]/div/img[1]");
	public final static By CCQ_FILTER_PARTNER		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[4]/div/img[1]");
	public final static By CCQ_FILTER_END_CUSTOMER		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[5]/div/img[1]");
	public final static By CCQ_FILTER_STATUS		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[6]/div/img[1]");
	public final static By CCQ_FILTER_CREATE_BY		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[7]/div/img[1]");
	public final static By CCQ_FILTER_CREATED		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[8]/div/img[1]");
	public final static By CCQ_FILTER_DUE_DATE		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[9]/div/img[1]");
	public final static By CCQ_FILTER_CUSTPO_NO		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[10]/div/img[1]");
	public final static By CCQ_FILTER_SALESREP		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[11]/div/img[1]");
	public final static By CCQ_FILTER_REV_STATUS		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[13]/div/img[1]");
	public final static By CCQ_LINK_CONTRACT_ID		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[1]/a");
	public final static By CCQ_LINK_CUSTOMER			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[2]/a");
	public final static By CCQ_LINK_TYPE			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[3]/a");
	public final static By CCQ_LINK_PARTNER			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[4]/a");
	public final static By CCQ_LINK_END_CUSTOMER				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[5]/a");
	public final static By CCQ_LINK_STATUS					= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[6]/a");
	public final static By CCQ_LINK_CREATE_BY		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[7]/a");
	public final static By CCQ_LINK_CREATED					= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[8]/a");
	public final static By CCQ_LINK_DUE_DATE					= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[9]/a");
	public final static By CCQ_LINK_CUSTPO_NO			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[10]/a");
	public final static By CCQ_LINK_SALESREP				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[11]/a");
	public final static By CCQ_LINK_REVISIONS			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[12]/a");
	public final static By CCQ_LINK_REV_STATUS			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[13]/a");
	public static void enter(){
		SpContractsChangePageUtil.enterChangesQuotes();
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CCQ_INPUT_USER,CCQ_LINK_CONTRACT_ID,CCQ_LINK_REV_STATUS
		});
	}
}
